home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / misc / volume10 / callback_hg / part02 < prev    next >
Encoding:
Text File  |  1990-01-06  |  11.2 KB  |  375 lines

  1. Newsgroups: comp.sources.misc
  2. subject: v10i002: modem callback program, part 2 of 2
  3. from: howard@hasse.ericsson.se (Howard Gayle)
  4. Sender: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  5.  
  6. Posting-number: Volume 10, Issue 2
  7. Submitted-by: howard@hasse.ericsson.se (Howard Gayle)
  8. Archive-name: callback_hg/part02
  9.  
  10. #! /bin/sh
  11. # This is a shell archive.  Remove anything before this line, then feed it
  12. # into a shell via "sh file" or similar.  To overwrite existing files,
  13. # type "sh file -c".
  14. # The tool that generated this appeared in the comp.sources.unix newsgroup;
  15. # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
  16. # If this archive is complete, you will see the following message at the end:
  17. #        "End of archive 2 (of 2)."
  18. # Contents:  FREEZE MakeCommon callback.1 uMakefile
  19. # Wrapped by howard@hasse on Fri Dec 29 10:22:52 1989
  20. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  21. if test -f 'FREEZE' -a "${1}" != "-c" ; then 
  22.   echo shar: Will not clobber existing file \"'FREEZE'\"
  23. else
  24. echo shar: Extracting \"'FREEZE'\" \(578 characters\)
  25. sed "s/^X//" >'FREEZE' <<'END_OF_FILE'
  26. X$Header: FREEZE,v 2.1 89/12/29 10:22:15 howard Exp $
  27. X$Log:    FREEZE,v $
  28. X# Revision 2.1  89/12/29  10:22:15  howard
  29. X# *** empty log message ***
  30. X# 
  31. X# Revision 1.1  89/12/26  09:50:08  howard
  32. X# Initial revision
  33. X# 
  34. X========================================
  35. XMakeCommon   1.1     1989-12-26 09:27:08
  36. XMakefile     1.2     1989-12-28 10:37:29
  37. XREADME       1.2     1989-12-29 10:17:06
  38. Xcallback.1   1.5     1989-12-29 10:16:57
  39. Xcallback.c   1.11    1989-12-28 10:34:24
  40. Xcallback.h   1.6     1989-12-28 16:43:44
  41. Xcallback0.c  1.6     1989-12-28 10:34:27
  42. XuMakefile    1.2     1989-12-28 10:50:49
  43. END_OF_FILE
  44. if test 578 -ne `wc -c <'FREEZE'`; then
  45.     echo shar: \"'FREEZE'\" unpacked with wrong size!
  46. fi
  47. # end of 'FREEZE'
  48. fi
  49. if test -f 'MakeCommon' -a "${1}" != "-c" ; then 
  50.   echo shar: Will not clobber existing file \"'MakeCommon'\"
  51. else
  52. echo shar: Extracting \"'MakeCommon'\" \(1155 characters\)
  53. sed "s/^X//" >'MakeCommon' <<'END_OF_FILE'
  54. X# MakeCommon - common definitions for uMakefile and Makefile for ~
  55. X#
  56. X# $Header: MakeCommon,v 1.1 89/12/26 09:27:08 howard Exp $
  57. X#
  58. X# Copyright 1990 Howard Lee Gayle
  59. X# This file is written in the ISO 8859/1 character set.
  60. X# 
  61. X# This program is free software; you can redistribute it and/or modify
  62. X# it under the terms of the GNU General Public License version 1,
  63. X# as published by the Free Software Foundation.
  64. X# 
  65. X# This program is distributed in the hope that it will be useful,
  66. X# but WITHOUT ANY WARRANTY; without even the implied warranty of
  67. X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  68. X# GNU General Public License for more details.
  69. X# 
  70. X# You should have received a copy of the GNU General Public License
  71. X# along with this program; if not, write to the Free Software
  72. X# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  73. X# 
  74. X
  75. X# Change mode of a file.
  76. XCHMOD=chmod
  77. X
  78. X# Get a file from the distribution directory.
  79. XDISTI=mkDistI
  80. X
  81. X# Remove a file.
  82. XRM=zap -f
  83. X
  84. X# Uncompress if necessary and check out from RCS or SCCS.
  85. XUNCMPRS=mkUncmprs
  86. X
  87. X# C include file search path.
  88. XINCLUDES=-I/usr/local/local-include -I/usr/local/free/howard/0/include
  89. END_OF_FILE
  90. if test 1155 -ne `wc -c <'MakeCommon'`; then
  91.     echo shar: \"'MakeCommon'\" unpacked with wrong size!
  92. fi
  93. # end of 'MakeCommon'
  94. fi
  95. if test -f 'callback.1' -a "${1}" != "-c" ; then 
  96.   echo shar: Will not clobber existing file \"'callback.1'\"
  97. else
  98. echo shar: Extracting \"'callback.1'\" \(5316 characters\)
  99. sed "s/^X//" >'callback.1' <<'END_OF_FILE'
  100. X.\" $Header: callback.1,v 1.5 89/12/29 10:16:57 howard Exp $
  101. X.TH CALLBACK 1 "$Revision: 1.5 $"
  102. X.SH NAME
  103. Xcallback \- accept call, call back, then accept login
  104. X.SH SYNOPSIS
  105. X.B callback
  106. X[
  107. X.I type
  108. X[
  109. X.I tty
  110. X] ]
  111. X.SH COPYRIGHT
  112. XCopyright \(co 1990 Howard Lee Gayle
  113. X.SH DESCRIPTION
  114. X.I callback
  115. Xallows a user to dial up a host,
  116. Xhave the host place a call back to the user,
  117. Xand then initiate a login session.
  118. XIt runs after
  119. X.IR getty (8)
  120. Xand before
  121. X.IR login (1).
  122. XWhen the user first dials up,
  123. Xgetty presents the usual login: prompt.
  124. XThe user can cycle through various line speeds in the usual way.
  125. XNext,
  126. X.I callback
  127. Xprompts for a symbolic telephone number.
  128. XThe prompt is the line speed, given twice.
  129. XOn receiving a known symbolic telephone number,
  130. X.I callback
  131. Xwrites "BYE bye,"
  132. Xdisconnects the call, waits a specified time 
  133. X(default 10 seconds),
  134. Xdials the real telephone number corresponding to the given
  135. Xsymbolic number,
  136. Xand then waits for connection.
  137. XIf a modem answers,
  138. X.I callback
  139. Xwrites the line speed, the number of times it tried to dial the
  140. Xtelephone number, and the line speed again.
  141. XIt then starts up login, which prompts for the password as usual.
  142. XIf a known symbolic telephone number is not supplied within a
  143. Xspecified time,
  144. Xor a connection with a modem is not established within a
  145. Xspecified time,
  146. X.I callback
  147. Xtimes out.
  148. XThe default timeout time is two minutes.
  149. X.PP
  150. X.I callback
  151. Xhas the same arguments as
  152. X.IR getty (8).
  153. X.SH EXAMPLE
  154. XThis example shows a session with a Hayes-compatible modem.
  155. XThe symbolic telephone number is "hovel."
  156. X.nf
  157. X   atdt9999999
  158. X
  159. X   CONNECT 2400
  160. X
  161. X   hasse login: howard
  162. X   2400 2400hovel
  163. X   BYE bye
  164. X
  165. X   NO CARRIER
  166. X
  167. X   RING
  168. X
  169. X   CONNECT 2400
  170. X
  171. X   2400 1 2400
  172. X   Password:
  173. X.fi
  174. X.SH FILES
  175. X.DT
  176. X.nf
  177. X/dev/ttyd* \- dialup ports
  178. X/dev/cua* \- dial-out ports
  179. X/etc/ttytab \- tells init to run callback on dialup lines
  180. X\&./bin/callback \- run by init
  181. X\&./bin/getty-cb \- special getty that execs /bin/.cb0 instead of login
  182. X/bin/.cb0 \- symbolic link to ./bin/callback0
  183. X\&./bin/callback0 \- run by getty-cb
  184. X/etc/local/callback/control/ttyd* \- symbolic-to-real phone numbers
  185. X/etc/local/callback/log/ttyd* \- log files
  186. X/etc/local/callback/state/ttyd* \- state files
  187. X.fi
  188. X.PP
  189. XIn control files, comments start with a semicolon (;) and
  190. Xcontinue to the end of the line.
  191. XOnce comments, blank lines, lines containing only comments, and
  192. Xleading and trailing white space have been stripped, each line
  193. Xof a control file should consist of one symbolic telephone
  194. Xnumber followed by an at sign (@) followed by a line speed
  195. Xfollowed by white space followed by a string to command the
  196. Xmodem to dial the desired real telephone number.
  197. XFor example:
  198. X.nf
  199. X   ; Shared control file for all lines.
  200. X   hovel@2400 atdt1234567 ; Howard's hovel.
  201. X   hovel@1200 atdt1234567 ; Same at 1200 bit/sec.
  202. X.fi
  203. XWhen
  204. X.I callback
  205. Xsearches the control file, it appends an at sign and the line
  206. Xspeed to the symbolic telephone number given by the user.
  207. XThis makes it possible to send different modem commands for
  208. Xeach line speed.
  209. X.PP
  210. XEach tty can have its own control file,
  211. Xbut if the control files of several different ttys are
  212. Xidentical, they can be links.
  213. X.SH "SEE ALSO"
  214. X.IR login (1),
  215. X.IR ttytab (5),
  216. X.IR getty (8).
  217. X.SH DIAGNOSTICS
  218. X"NO no" indicates an unknown symbolic telephone number.
  219. XA time delay of a few seconds is taken to discourage brute-force attacks.
  220. X.SH BUGS
  221. XFor more security, it might be a good idea to turn off echo
  222. Xwhen reading the symbolic telephone number.
  223. XIt might also be a good idea to store symbolic telephone
  224. Xnumbers in encrypted form.
  225. X.PP
  226. XThere ought to be a secure way to add a new symbolic telephone
  227. Xnumber and its corresponding real telephone number without
  228. Xlogging in.
  229. XThis would be useful when travelling.
  230. XAn approach based on one-time encryption should solve the
  231. Xproblem.
  232. XThe user would first encrypt the real telephone number with a
  233. Xone-time pad corresponding to a special symbolic telephone
  234. Xnumber,
  235. X.I e.g.
  236. Xby treating the telephone number as a decimal number and adding
  237. Xanother number to it.
  238. XThis can be done by hand.
  239. XThe user then dials up and responds to the symbolic telephone
  240. Xnumber prompt with a special keyword.
  241. X.I callback
  242. Xthen prompts for the symbolic telephone number and the
  243. Xencrypted real telephone number (twice),
  244. Xdecrypts it, and stores it in the control file.
  245. X.PP
  246. X.I callback
  247. Xalways calls back on the line used for the incoming call.
  248. XIf multiple lines are available, it should be possible to place
  249. Xthe callback on a different line.
  250. XThis greatly reduces the opportunities for spoofing.
  251. X.SH LICENSE
  252. XThis program is free software; you can redistribute it and/or modify
  253. Xit under the terms of the GNU General Public License version 1,
  254. Xas published by the Free Software Foundation.
  255. X.PP
  256. XThis program is distributed in the hope that it will be useful,
  257. Xbut WITHOUT ANY WARRANTY; without even the implied warranty of
  258. XMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  259. XGNU General Public License for more details.
  260. X.PP
  261. XYou should have received a copy of the GNU General Public License
  262. Xalong with this program; if not, write to the Free Software
  263. XFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  264. X.SH AUTHOR
  265. XHoward Gayle,
  266. XTN/ETX/TT/HL,
  267. XEricsson Telecom AB,
  268. XS-126 25 Stockholm,
  269. XSweden,
  270. Xhoward@ericsson.se,
  271. Xuunet!ericsson.se!howard,
  272. XPhone: +46 8 719 5565,
  273. XFAX: +46 8 719 9598,
  274. XTelex: 14910 ERIC S
  275. END_OF_FILE
  276. if test 5316 -ne `wc -c <'callback.1'`; then
  277.     echo shar: \"'callback.1'\" unpacked with wrong size!
  278. fi
  279. # end of 'callback.1'
  280. fi
  281. if test -f 'uMakefile' -a "${1}" != "-c" ; then 
  282.   echo shar: Will not clobber existing file \"'uMakefile'\"
  283. else
  284. echo shar: Extracting \"'uMakefile'\" \(1448 characters\)
  285. sed "s/^X//" >'uMakefile' <<'END_OF_FILE'
  286. X# uMakefile - micro GNU makefile for callback
  287. X#
  288. X# $Header: uMakefile,v 1.2 89/12/28 10:50:49 howard Exp $
  289. X#
  290. X# Copyright 1990 Howard Lee Gayle
  291. X# This file is written in the ISO 8859/1 character set.
  292. X# 
  293. X# This program is free software; you can redistribute it and/or modify
  294. X# it under the terms of the GNU General Public License version 1,
  295. X# as published by the Free Software Foundation.
  296. X# 
  297. X# This program is distributed in the hope that it will be useful,
  298. X# but WITHOUT ANY WARRANTY; without even the implied warranty of
  299. X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  300. X# GNU General Public License for more details.
  301. X# 
  302. X# You should have received a copy of the GNU General Public License
  303. X# along with this program; if not, write to the Free Software
  304. X# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  305. X# 
  306. X
  307. Xinclude MakeCommon
  308. X
  309. X# Commands:
  310. X
  311. X# Make depend file that shows include files that C programs use.
  312. XDEPEND=mkCIncl
  313. X
  314. X# Make FREEZE.*.
  315. XMKFREEZE=mkFreeze
  316. X
  317. X# Sources:
  318. XCS := $(filter %.c,$(SRCS))
  319. XHS := $(filter %.h,$(SRCS))
  320. X
  321. X# Targets:
  322. Xit = FREEZE.i
  323. X
  324. Xtargets := $(it) Makefile depend
  325. X
  326. Xifdef WORK
  327. X.DEFAULT:
  328. X    $(UNCMPRS) $@
  329. Xelse # WORK
  330. X.DEFAULT:
  331. X    $(DISTI) $@ $(DD)
  332. Xendif # WORK
  333. X
  334. X.SUFFIXES:
  335. X.PHONY: default
  336. X
  337. Xdefault: $(targets)
  338. X
  339. Xifndef WORK
  340. XMakefile: $(DD)/Makefile
  341. X    $(DISTI) $@ $(DD)
  342. Xendif # WORK
  343. X
  344. Xdepend: $(CS) $(HS) $(it)
  345. X    $(DEPEND) "$(INCLUDES)" $(CS) > $@
  346. X
  347. XFREEZE.i: FREEZE
  348. X    $(RM) FREEZE.*
  349. X    $(MKFREEZE)
  350. X    $(CHMOD) a=r FREEZE.*
  351. END_OF_FILE
  352. if test 1448 -ne `wc -c <'uMakefile'`; then
  353.     echo shar: \"'uMakefile'\" unpacked with wrong size!
  354. fi
  355. # end of 'uMakefile'
  356. fi
  357. echo shar: End of archive 2 \(of 2\).
  358. cp /dev/null ark2isdone
  359. MISSING=""
  360. for I in 1 2 ; do
  361.     if test ! -f ark${I}isdone ; then
  362.     MISSING="${MISSING} ${I}"
  363.     fi
  364. done
  365. if test "${MISSING}" = "" ; then
  366.     echo You have unpacked both archives.
  367.     rm -f ark[1-9]isdone
  368. else
  369.     echo You still need to unpack the following archives:
  370.     echo "        " ${MISSING}
  371. fi
  372. ##  End of shell archive.
  373. exit 0
  374.  
  375.